#ifndef __GAME_PLAY_LAYER__
#define __GAME_PLAY_LAYER__

#include "cocos2d.h"
#include "cocos-ext.h"
USING_NS_CC;
USING_NS_CC_EXT;

enum MenuType
{
	MT_START,
	MT_GAMEOVER,
};

enum GameState
{
	GS_MENU_START,
	GS_PLAY,
};

class Terrain;

class GamePlayLayer : public CCLayer
{
public:
	GamePlayLayer();
	~GamePlayLayer();

	bool init();
	CREATE_FUNC(GamePlayLayer);
	void update(float delta);
	
	void showMenu(int menuType);

	CCLabelTTF* scoreLabel;
	CCLabelTTF* highScoreLabel;
	CCControlButton* replayButton;
	CCControlButton* highScoreButton;
	CCControlButton* voteButton;
	//CCSprite* gameOverSprite;
	CCSprite* hintSprite;
	CCLabelTTF* bigTextLabel;
	int state;
	void setState(int state);
	void shake();

private:
	CCSprite* backgroundSprite;
	Terrain* terrain;
	void draw();
	void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
	bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
	void replayButtonTouched(CCObject* sender, CCControlEvent event);
	void highScoreButtonTouched(CCObject* sender, CCControlEvent event);
	void voteButtonTouched(CCObject* sender, CCControlEvent event);
	void preloadSound();
};
#endif // !__GAME_PLAY_LAYER__
